<?php
	$setDate = !empty($_REQUEST['setDate']) ? $_REQUEST['setDate'] : date('Y-m-d', time()); 
	$linenum = isset($_REQUEST['linenum']) ? $_REQUEST['linenum'] : '10';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="Cache-Control" content="No-Cache">
	<meta http-equiv="Pragma" content="No-Cache">

	<title>운세의신</title>
	
	<link rel="stylesheet" type="text/css" href="/css/common.css">
	<link rel="stylesheet" type="text/css" href="/css/sub.css">
	<link rel="stylesheet" type="text/css" href="/css/free.css">

	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
	<script type="text/javascript">
		String.prototype.trim = function() {
			this.replace(/(^\s*)|(\s*$)/gi, "");
		};

		$(document).ready(function() {
			
			// 메뉴 링크 설정
			$(".zodiac .sign ul li a").each(function(index) {
				$(this).click(function() {
					$(".conts .zbox").hide();
					var linename = $(this).text().replace(" ", "");
					$(".linename").each(function(index) {
						var thisLinename = $(this).text().replace(" ", "");
						if (linename == thisLinename) {
							$(".conts .zbox").eq(index).show();
						}
					});
				});
			});
			
			// 기본적으로 성격 탭을 보여준다. 
			$(".conts .zbox").hide();
			$(".conts .zbox").eq($("#linenum").val()).show();
			
			$(".year tbody tr:last th").addClass('end');
			$(".year tbody tr:last td").addClass('end');
		});
	</script>

</head>
<body>
<input type="hidden" id="linenum" value="<?=$linenum?>" />
<div id="wrap">
	<!-- Header -->
	<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/commons/main_header.php'; ?>
	<!--// Header -->
	
	<!--커튼 데코레이션-->
	<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/commons/drape.php'; ?>
	<!--//커튼 데코레이션-->
	
	<!--컨텐츠-->
	<div id="content">
		<!--휘장-->
		<div class="keybox1"> </div>
		<!--//휘장-->

		<p class="key_visual"><img src="/images/sub/free/free_visual.png" alt="무료운세" /></p>	
		
		<!--왼쪽컨텐츠-->
		<div class="assistant">
			<!--왼쪽 메뉴-->
			<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/commons/inc_lnb.php'; ?>
			<!--// 왼쪽 메뉴-->

			<!--추천테마-->
			<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/static/theme2.php'; ?>
			<!--//추천테마-->

			<!--회원가입-->
			<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/static/member_join.php'; ?>
			<!--//회원가입-->

			<!--고객센터-->
			<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/static/cs.php'; ?>
			<!--//고객센터_추가-->
		</div>
		<!--//왼쪽컨텐츠-->

		<!-- 메인컨텐츠-->
		<a name="pp"></a>
		<div class="cont">
			<div class="zodiac">
				<h3 class="freetit"><img src="/images/free/todayline_banner.png" alt="오늘의 띠별 운세" /></h3>
				<div class="box">
					<div class="sign blind">
						<ul>
							<li><a href="javascript:;" class="sign01">쥐띠</a></li>
							<li><a href="javascript:;" class="sign02">소띠</a></li>
							<li><a href="javascript:;" class="sign03">범띠</a></li>
							<li><a href="javascript:;" class="sign04">토끼띠</a></li>
							<li><a href="javascript:;" class="sign05">용띠</a></li>
							<li><a href="javascript:;" class="sign06">뱀띠</a></li>
							<li><a href="javascript:;" class="sign07">말띠</a></li>
							<li><a href="javascript:;" class="sign08">양띠</a></li>
							<li><a href="javascript:;" class="sign09">원숭이띠</a></li>
							<li><a href="javascript:;" class="sign10">닭띠</a></li>
							<li><a href="javascript:;" class="sign11">개띠</a></li>
							<li><a href="javascript:;" class="sign12">돼지띠</a></li>
						</ul>
					</div><!--sign-->
					
					<div class="todaydate">
						<p class="year">
							<img src="/images/common/day/day_<?=substr($setDate, 0,1)?>.png" alt="년도" />
							<img src="/images/common/day/day_<?=substr($setDate, 1,1)?>.png" alt="년도" />
							<img src="/images/common/day/day_<?=substr($setDate, 2,1)?>.png" alt="년도" />
							<img src="/images/common/day/day_<?=substr($setDate, 3,1)?>.png" alt="년도" />
							<img src="/images/common/day/day_dot.png" alt="점" />
						</p>
						<p>
							<img src="/images/common/day/day_<?=substr($setDate, 5,1)?>.png" alt="월" />
							<img src="/images/common/day/day_<?=substr($setDate, 6,1)?>.png" alt="월" />
							<img src="/images/common/day/day_dot.png" alt="점" />
						</p>
						<p>
							<img src="/images/common/day/day_<?=substr($setDate, 8,1)?>.png" alt="일" />
							<img src="/images/common/day/day_<?=substr($setDate, 9,1)?>.png" alt="일" />
						</p>
					</div><!--date-->
					
					<div class="conts">
<?	foreach ($contents['F022'] as $item) : ?>
<?
		$arr_tmp = explode(":", $item['db_data2']);
		$data[0]['title'] = trim($arr_tmp[0]);
		$data[0]['content'] = trim($arr_tmp[1]);
		$arr_tmp = explode(":", $item['db_data3']);
		$data[1]['title'] = trim($arr_tmp[0]);
		$data[1]['content'] = trim($arr_tmp[1]);
		$arr_tmp = explode(":", $item['db_data4']);
		$data[2]['title'] = trim($arr_tmp[0]);
		$data[2]['content'] = trim($arr_tmp[1]);
		if (!empty($item['db_data5'])) {
			$arr_tmp = explode(":", $item['db_data5']);
			$data[3]['title'] = trim($arr_tmp[0]);
			$data[3]['content'] = trim($arr_tmp[1]);
		}
?>
						<div class="zbox">
							<div class="title">
								<dl>
									<dt class="linename"><?=$item['line_name']?></dt>
									<dd><?=$item['db_data1']?></dd>
								</dl>
							</div><!--title-->
							<div class="year">
								 <table width="100%" summary="띠 년도별운세" cellpadding="0" cellspacing="0">
									<caption class="blind"> 년도운세</caption>
									<colgroup>
										<col width="10%" />
										<col width="*" />
									</colgroup>
									<tbody>
<?		foreach ($data as $cont) : ?>
										<tr>
											<th scope="row"><?=$cont['title']?></th>
											<td><?=$cont['content']?></td>
										</tr>
<?		endforeach ?>
									</tbody>
								 </table>
							</div><!--year-->
						</div><!--zbox-->
<?	endforeach ?>
					</div><!--conts-->
				</div><!--box-->
			</div><!--zodiac-->
			<!--하단컨텐츠-->  
			<!--//하단컨텐츠-->  
		</div>	
		<!--// Contents -->
		<!--서비스배너-->
        <? include_once $_SERVER['DOCUMENT_ROOT'].'/include/static/bn_service.php'; ?>
        <!--//서비스배너--> 
	</div>
	<!--// 메인컨텐츠-->

	<!-- Footer -->
	<? include_once $_SERVER['DOCUMENT_ROOT'].'/include/commons/main_footer.php'; ?>
	<!--// Footer -->
   
</div>
</body>
</html>